with v8.Class_Object, v8.Class_Value;
package v8.Class_Array is
   type Array_T (<>) is new v8.Class_Object.Object with private;
   type Pointer is access all Array_T;
   -- An instance of the built-in array constructor (ECMA-262, 15.4.2).

   function Length
     (this : Array_T
     ) return uint32_t;

   function Clone_Element_At
     (this  : Array_T;
      index : uint32_t
     ) return v8.CLass_Object.Pointer;
   -- Clones an element at index |index|.  Returns an empty
   -- handle if cloning fails (for any reason).
   -- return Local<Object>


   function Create (length : Integer := 0) return Pointer;
   -- Creates a JavaScript array with the given length. If the length
   -- is negative the returned array will have length 0.

   function Cast is new Ada.Unchecked_Conversion (v8.Class_Value.Pointer, Pointer);
   -- Convert Value to Array

private
   type Array_T is new v8.Class_Object.Object with null record;

   pragma Import (CPP, Length, "_ZNK2v85Array6LengthEv");
   pragma Import (CPP, Clone_Element_At, "_ZN2v85Array14CloneElementAtEj");
   pragma Import (CPP, Create, "_ZN2v85Array3NewEi");

end v8.Class_Array;
